<template>
  <Loading v-if="isLoading" @loaded="switchToLogin"/>
  <Login v-if="isLogin" @logined="switchToDesktop"/>
  <Desktop v-if="isDesktop"/>
</template>

<script setup>
  import { ref } from 'vue'
  import Loading from 'views/Loading.vue'
  import Login from 'views/Login.vue'
  import Desktop from 'views/Desktop.vue'

  const isLoading = ref(true)
  const isLogin = ref(false)
  const isDesktop = ref(false)
  const switchToLogin = () => {
    isLoading.value = false
    isLogin.value = true
  }
  const switchToDesktop = () => {
    isLogin.value = false
    isDesktop.value = true
  }
</script>

